<script setup>
import enUS from "ant-design-vue/es/locale/en_US";
import zhCN from "ant-design-vue/es/locale/zh_CN";
import store from "@/store";
import { computed, ref, watch } from "vue";

import dayjs from "dayjs";
import "dayjs/locale/zh-cn";
dayjs.locale(zhCN.locale);

const locale = computed(() => {
  return store.getters["webset/lang"];
});

watch(locale, (val) => {
  dayjs.locale(val);
});
</script>

<template>
  <a-config-provider :locale="locale === 'en' ? enUS : zhCN">
    <router-view />
  </a-config-provider>
</template>
